﻿<UserControl x:Class="Kaskelot.SP.UI.Analys.Controls.FilterBox"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:local="clr-namespace:Kaskelot.SP.UI.Analys.FilterComponents"
    mc:Ignorable="d"
    d:DesignHeight="350" d:DesignWidth="700">

	<UserControl.Resources>
		<DataTemplate x:Key="ComboBoxEditor">
			<telerik:RadComboBox SelectedValue="{Binding Value, Mode=TwoWay, FallbackValue=null}" CanAutocompleteSelectItems="True"
                               telerik:StyleManager.Theme="Summer">
			</telerik:RadComboBox>
		</DataTemplate>
		<!-- SelectedValue="{Binding Value, Mode=TwoWay, FallbackValue=null}"-->
		<local:EditorTemplateSelector x:Key="EditorTemplateSelector" x:Name="EditorTemplateSelector">
			<!--<local:EditorTemplateSelector.EditorTemplateRules>
                <local:EditorTemplateRule PropertyName="ProjectTypeID"
                                       DataTemplate="{StaticResource ComboBoxEditor}" />
            </local:EditorTemplateSelector.EditorTemplateRules>-->
		</local:EditorTemplateSelector>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" Background="Transparent" HorizontalAlignment="Left">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*" />
			<ColumnDefinition Width="30" />
		</Grid.ColumnDefinitions>
		<telerik:RadPaneGroup Grid.Column="0" Margin="10,10,0,10" HorizontalAlignment="Left" Name="PaneGroup" telerik:StyleManager.Theme="Summer" Width="690" Height="300" Visibility="Collapsed">
			<telerik:RadPane Name="ProjectPane" Width="690" Title="Välj filter" CanUserClose="False" CanFloat="False" CanUserPin="False" CanDockInDocumentHost="False" ContextMenuTemplate="{x:Null}">
				<telerik:RadPane.Content>
					<ScrollViewer>
						<telerik:RadDataFilter Name="Filter"
							MinWidth="640" 
							telerik:StyleManager.Theme="Summer" 
							CanUserCreateCompositeFilters="True" 
							EditorTemplateSelector="{StaticResource EditorTemplateSelector}" 
							EditorCreated="Filter_EditorCreated" 
							FilterOperatorsLoading="FilterOperatorsLoading">
						</telerik:RadDataFilter>
					</ScrollViewer>
				</telerik:RadPane.Content>
			</telerik:RadPane>
		</telerik:RadPaneGroup>
		<StackPanel Grid.Column="1" Orientation="Vertical">
			<HyperlinkButton x:Name="ToggleFiltersButton" Click="ToggleFiltersButton_Click" Height="21" Width="21" BorderBrush="Transparent">
				<StackPanel>
					<Image x:Name="ExpandImage" Source="/Kaskelot.SP.UI.Analys;component/Images/Expand.png" Visibility="Visible" />
					<Image x:Name="CollapseImage" Source="/Kaskelot.SP.UI.Analys;component/Images/Collapse.png" Visibility="Collapsed" />
				</StackPanel>
			</HyperlinkButton>
		</StackPanel>
	</Grid>
</UserControl>
